<template>
    <div>
        <div class="jumbotron">
            <h1 class="display-4">Hello, {{ username }}</h1>
            <p class="lead">所属部门:部门{{ department }}, 职位:{{ joblist[job] }}</p>
            <p class="lead">欢迎使用考勤管理系统.</p>
            <hr class="my-4">
            <p>点击按钮快速跳转到考勤界面</p>
            <a class="btn btn-primary btn-lg" href="#" role="button" @click="directTo"> 前往考勤界面 </a>
        </div>
    </div>
</template>
  
<script>
export default {
    name: 'Dashboard',
    data() {
        return {
            username: '',
            department: '',
            job: '',
            joblist: ['员工', '部门经理', '人事部职员', '总经理']
        }
    },
    mounted() {
        this.username = localStorage.getItem("name")
        this.department = localStorage.getItem("department")
        this.job = localStorage.getItem("job")
    },
    methods: {
        directTo() {
            this.$router.push('/home/signinout')
        }
    }
}
</script>
  
<style lang="less" scoped></style>